﻿Option Strict On
Option Explicit On
Option Infer On

Imports System

Public Enum Scope
   [Unknown] = 0
   [Friend]
   [Public]
   [Private]
   [Protected]
   [ProtectedFriend]
End Enum

Namespace VB
   Public Module ScopeExtensions
      <System.Runtime.CompilerServices.Extension()> _
      Public Function Output(ByVal Scope As Scope) As String
         Dim ret As String = String.Empty
         If Scope = TemplateSupport.Scope.Friend Then
            Return "Friend"
         ElseIf Scope = TemplateSupport.Scope.Public Then
            Return "Public"
         ElseIf Scope = TemplateSupport.Scope.Private Then
            Return "Private"
         ElseIf Scope = TemplateSupport.Scope.Protected Then
            Return "Protected"
         ElseIf Scope = TemplateSupport.Scope.ProtectedFriend Then
            Return "ProtectedFriend"
         End If
         Return String.Empty
      End Function
   End Module
End Namespace

Namespace CSharp
   Public Module ScopeExtensions
      <System.Runtime.CompilerServices.Extension()> _
      Public Function Output(ByVal Scope As Scope) As String
         Dim ret As String = String.Empty
         If (Scope And TemplateSupport.Scope.Friend) = TemplateSupport.Scope.Friend Then
            ret &= "internal"
         ElseIf (Scope And TemplateSupport.Scope.Private) = TemplateSupport.Scope.Private Then
            ret &= "private"
         ElseIf (Scope And TemplateSupport.Scope.Protected) = TemplateSupport.Scope.Protected Then
            ret &= "protected"
         ElseIf (Scope And TemplateSupport.Scope.ProtectedFriend) = TemplateSupport.Scope.ProtectedFriend Then
            ret &= "protected internal"
         ElseIf (Scope And TemplateSupport.Scope.Public) = TemplateSupport.Scope.Public Then
            ret &= "public"
         End If
         Return ret
      End Function
   End Module
End Namespace